package com.mybatis.config;

import com.alibaba.fastjson.JSONObject;
import lombok.Builder;
import okhttp3.*;

import java.io.IOException;
import java.math.BigInteger;
import java.util.List;

/**
 * @author liuxiaoding
 * @Date 2019/12/19
 **/
public class EthereumUtil {
    public static void main(String[] args) throws Exception{
        OkHttpClient client = new OkHttpClient();

        MediaType mediaType = MediaType.parse("multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW");
        RequestBody body = RequestBody.create(mediaType, "------WebKitFormBoundary7MA4YWxkTrZu0gW\r\nContent-Disposition: form-data; name=\"uploadfile\"; filename=\"9252150_150552938000_2.jpg\"\r\nContent-Type: image/jpeg\r\n\r\n\r\n------WebKitFormBoundary7MA4YWxkTrZu0gW--");
        Request request = new Request.Builder()
                .url("https://mt2.aoliaomall.cn/user/imgup.html")
                .post(body)
                .addHeader("content-type", "multipart/form-data; boundary=----WebKitFormBoundary7MA4YWxkTrZu0gW")
                .addHeader("cache-control", "no-cache")
                .addHeader("postman-token", "ae17c5a1-f101-182b-ac30-5c7cc0eede84")
                .build();


        Response response = client.newCall(request).execute();

        System.out.println(new String(response.body().bytes()));
    }
}
